import express from 'express'
const router = express.Router();
import tokenHandler from "../middleware/token.middleware";
import controller from '../controllers/message.controller'
import validate from '../middleware/validator.middleware';
import MessageSchemas from '../schemas/message.schemas';

router.use(tokenHandler)
router.post('/', validate(MessageSchemas.sendMessage), controller.sendMessage);
router.post('/upload', controller.uploadFile);
router.get('/file', validate(MessageSchemas.download), controller.downloadFile);
router.get('/cover', validate(MessageSchemas.download), controller.downloadCover);

export default router